import router from ".";
import store from "@/store";
const whiteList=['/login']
router.beforeEach((to,from ,next)=>{
    if(store.getters.token){
        console.log(store.getters.token,to,from ,next,'store.getters.token')
        if(to.path==='/login'){
            next('/')
        }else{
            next()

        }
    }else{
        if(whiteList.includes(to.path)){
            next()
        }else{
            next('/login')
        }
    }
})